/************************************************************************
* Controller class, handle user interaction, update model
* Author : Shaolan
* Version : 1.0
* Website : http://shaolan.net
*/
#ifndef MODEL_HEADER
	#include "model.hpp"
	#define MODEL_HEADER 1
#endif

#ifndef LIBGE_HEADER
	#include <libge/libge.h>
	#define LIBGE_HEADER 1
#endif

#define N_KEYS 8


enum Signal { SIGDONE , SIGWIN , SIGLOST};

class Controller {
	protected:
		Model * model;
		ge_Keys * input;
		// Callback method
		Signal crossCallback();
		Signal circleCallback();
		Signal squareCallback();
		Signal triangleCallback();
		Signal upCallback();
		Signal downCallback();
		Signal leftCallback();
		Signal rightCallback();	
	public:
		typedef Signal (Controller::*Callback)();
		static int Keys[];
		static Callback action[];
		Controller();
		Controller(Model *);
		~Controller();
		Model * getModel() const;
		void setModel(Model *);
		bool update();	
};